<!--
@function: 版权显示
@author:WZH
@description:自带蓝色背景色的版权显示组件.
  1、copyrightType是版权的类型，类型值有以下5种：english-long、english-short、chinese-long、mixture和simple；默认值为simple。
  2、authorOrOwner是版权的拥有者，必传入一个初始数据源。
  3、copyrightDates表示版权时间，调用时传入自定义时间，则显示自定义内容；若未传入自定义时间，默认显示当前年份。
  4、webSite表网址，要显示，直接传入相应网址即可。
  5、该组件在<el-footer>中调用。
-->
<template>
  <div class="footer">
    <span v-if="copyrightType == 'english-long'">Copyright © {{dates}} {{webSite}} {{authorOrOwner}}. All rights reserved.</span>
    <span v-else-if="copyrightType == 'english-short'">©{{dates}} {{webSite}} {{authorOrOwner}}. All rights reserved.</span>
    <span v-else-if="copyrightType =='chinese-long'">©{{dates}} {{webSite}} {{authorOrOwner}} 版权所有</span>
    <span v-else-if="copyrightType =='mixture'">Copyright {{dates}} {{webSite}} {{authorOrOwner}} 版权所有</span>
    <span v-else-if="copyrightType =='simple'">©{{dates}} {{webSite}} {{authorOrOwner}}</span>
  </div>
</template>
<script>
export default {
  name: "copyright",
  props: {
    copyrightType: { //版权类型
      type: String,
      default: "simple"
    },
    copyrightDates: { //版权的时间
      type: String,
      default: ""
    },
    authorOrOwner: { //版权拥有者
      type: String,
      default: ""
    },
    webSite: { //拥有者网址
      type: String,
      default: ""
    }
  },
  created: function() {
    var me = this;
     //若传入自定义时间，显示传入的值；若没有，默认显示当前年份
    if(me.copyrightDates != '' && me.copyrightDates != null){
      me.dates = me.copyrightDates;
    }else{
      me.dates = new Date().getFullYear();
    }
  },
  data() {
    return {
      dates:''
    };
  }
}
</script>
<style lang="scss">
@import "../../assets/scss/basic.scss";

   .footer {
      background-color: $--color-primary-light-3;
      text-align: center;
      color: $--color-white;
      line-height: 30px;
      padding:0px;
      margin:0px;
    }
</style>
